import {Component, Input, OnInit} from '@angular/core';
import {DynamicComponent} from '../../../../index';

@Component({
  selector: 'sex',
  templateUrl: './sex.component.html',
  styleUrls: ['./sex.component.scss']
})
export class SexComponent implements OnInit, DynamicComponent {
    @Input() cssClass: string;
    @Input() text: string;
    dynamic: true;

    set data(values) {
        this.cssClass = values.cssClass;
        if (values.text === 1) {
            this.text = '女';
        } else {
            this.text = '男';
        }
    }

    constructor() {
    }

    ngOnInit() {
    }
}
